  Future weak lensing measurements of cosmic shear will reach such high
accuracy that second order effects in weak lensing modeling, like the influence
of baryons on structure formation, become important. We use a controlled set of
state of the art cosmological simulations to quantify this effect by comparing
pure N-body dark matter runs with corresponding hydrodynamical simulations,
carried out both in non-radiative, and in dissipative form with cooling and
star formation. In both hydrodynamical simulations, the clustering of the gas
is suppressed while that of dark matter is boosted at scales k>1 h/Mpc. Despite
this counterbalance between dark matter and gas, the clustering of the total
matter is suppressed by up to 1 percent at 1<k<10 h/Mpc, while for k ~ 20 h/Mpc
it is boosted, up to 2 percent in the non-radiative run and 10 percent in the
run with star formation. The stellar mass formed in the latter is highly biased
relative to the dark matter in the pure N-body simulation. Using our power
spectrum measurements to predict the effect of baryons on the weak lensing
signal at 100<l<10000, we find that baryons may change the lensing power
spectrum by less than 0.5 percent at l<1000, but by 1 to 10 percent at
1000<l<10000. The size of the effect exceeds the predicted accuracy of future
lensing power spectrum measurements and will likely be detected. Precise
determinations of cosmological parameters with weak lensing, and studies of
small-scale fluctuations and clustering, therefore rely on properly including
baryonic physics.
