Photovoltaic and photoelectrochemical conversion of solar energy