The variation with time from 1956-2002 of the globally averaged rate of ionization produced by cosmic rays in the atmosphere is deduced and shown to have a cyclic component of period roughly twice the 11 year solar cycle period. Long term variations in the global average surface temperature as a function of time since 1956 are found to have a similar cyclic component. The cyclic variations are also observed in the solar irradiance and in the mean daily sun spot number. The cyclic variation in the cosmic ray rate is observed to be delayed by 2-4 years relative to the temperature, the solar irradiance and daily sun spot variations suggesting that the origin of the correlation is more likely to be direct solar activity than cosmic rays. Assuming that the correlation is caused by such solar activity, we deduce that the maximum recent increase in the mean surface temperature of the Earth which can be ascribed to this activity is $lesssim14%$ of the observed global warming.