This paper estimates the welfare-optimal market share of wind and solar power, explicitly taking into account their output variability. We present a theoretical valuation framework that consistently accounts for output variability over time, forecast errors, and the location of generators in the power grid, and evaluate the impact of these three factors on the marginal value of electricity from renewables. Then we estimate the optimal share of wind and solar power in Northwestern Europe from a calibrated numerical power market model. The optimal long-term share of wind power of total electricity consumption is estimated to be 20% at cost levels of 50 €/MWh, about three times the current market share of wind; but this estimate is subject to significant parameter uncertainty. Variability significantly impacts results: if winds were constant, the optimal share would be 60%. In addition, the effect of technological change, price shocks, and policies on the optimal share is assessed. We present and explain several surprising findings, including a negative impact of CO2 prices on optimal wind deployment.