Nanowire photochemical diodes for artificial photosynthesis