Water bills are to rise by an average of 21% over the next five years, the industry regulator Ofwat has ruled.