Visible-light-transparent p-type NiO films were deposited by reactive RF sputtering under unintentional heating. An optical transmittance of >80% was obtained in the wavelength range of 500-800nm when the films were deposited under a very low O2 fraction in the gas phase O2/(Ar + O) = 0.5%. This result may reflect a decrease in the concentration of Ni vacancies due to the increase in their formation energy under oxygen-poor deposition conditions. Heterostructure pn junctions consisting of p-type NiO and n-type ZnO layers were also deposited. We eventually observed a slight but noticeable photovoltaic effect.