Hydrogen and oxygen production from water