Photolysis of water and photoreduction of nitrogen on titanium dioxide