Electrolysis of water for hydrogen production