On the photoelectrocatalytic reduction of carbon dioxide