Yorkshire Water has been ordered to refund customers £36 million next year through lower bills after missing key targets on pollution.