Upcoming weak lensing surveys, such as LSST, EUCLID, and WFIRST, aim to measure the matter power spectrum with unprecedented accuracy. In order to fully exploit these observations, models are needed that, given a set of cosmological parameters, can predict the non-linear matter power spectrum at the level of 1% or better for scales corresponding to comoving wave numbers 0.1<k<10 h/Mpc. We have employed the large suite of simulations from the OWLS project to investigate the effects of various baryonic processes on the matter power spectrum. In addition, we have examined the distribution of power over different mass components, the back-reaction of the baryons on the CDM, and the evolution of the dominant effects on the matter power spectrum. We find that single baryonic processes are capable of changing the power spectrum by up to several tens of per cent. Our simulation that includes AGN feedback, which we consider to be our most realistic simulation as, unlike those used in previous studies, it has been shown to solve the overcooling problem and to reproduce optical and X-ray observations of groups of galaxies, predicts a decrease in power relative to a dark matter only simulation ranging, at z=0, from 1% at k~0.3 h/Mpc to 10% at k~1 h/Mpc and to 30% at k~10 h/Mpc. This contradicts the naive view that baryons raise the power through cooling, which is the dominant effect only for k>70 h/Mpc. Therefore, baryons, and particularly AGN feedback, cannot be ignored in theoretical power spectra for k>0.3 h/Mpc. It will thus be necessary to improve our understanding of feedback processes in galaxy formation, or at least to constrain them through auxiliary observations, before we can fulfil the goals of upcoming weak lensing surveys.