In this work we investigate the effects of photoionization on the charge state composition of the solar wind. Using measured solar EUV and X-ray irradiance, the Michigan Ionization Code and a model for the fast and slow solar wind, we calculate the evolution of the charge state distribution of He, C, N, O, Ne, Mg, Si, S, and Fe with and without including photoionization for both types of wind. We find that the solar radiation has significant effects on the charge state distribution of C, N, and O, causing the ionization levels of these elements to be higher than without photoionization; differences are largest for oxygen. The ions commonly observed for elements heavier than O are much less affected, except in ICMEs where Fe ions more ionized than 16+ can also be affected by the solar radiation. We also show that the commonly used O7+/O6+ density ratio is the most sensitive to photoionization; this sensitivity also causes the value of this ratio to depend on the phase of the solar cycle. We show that the O7+/O6+ ratio needs to be used with caution for solar wind classification and coronal temperature estimates, and recommend the C6+/C4+ ratio for these purposes.