We present calculations of structural and magnetic properties of the iron-pnictide superconductor LaFeAsO including electron-electron correlations. For this purpose we apply a fully charge self-consistent combination of density-functional theory with the dynamical mean-field theory, allowing for the calculation of total energies. We find that the inclusion of correlation effects gives a good agreement of the arsenic z position with experimental data even in the paramagnetic (high-temperature) phase. Going to low temperatures, we study the formation of the ordered moment in the striped spin-density-wave phase, yielding an ordered moment of about 0.60 mu(B), again in good agreement with experiments. This shows that the inclusion of correlation effects improves both structural and magnetic properties of LaFeAsO at the same time.