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 per cent or better for scales corresponding to comoving wavenumbers 0.1 ≲k≲ 10 h Mpc−1. We have employed the large suite of simulations from the OverWhelmingly Large Simulations (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 cold dark matter 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 per cent at k≈ 0.3 h Mpc−1 to 10 per cent at k≈ 1 h Mpc−1 and to 30 per cent at k≈ 10 h Mpc−1. This contradicts the naive view that baryons raise the power through cooling, which is the dominant effect only for k≳ 70 h Mpc−1. Therefore, baryons, and particularly AGN feedback, cannot be ignored in theoretical power spectra for k≳ 0.3 h Mpc−1. 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.