  A model of nonlinear electromagnetic fields with a dimensional parameter
$\beta$ is proposed. From PVLAS experiment the bound on the parameter $\beta$
was obtained. Electromagnetic fields are coupled with the gravitation field and
we show that the universe accelerates due to nonlinear electromagnetic fields.
The magnetic universe is considered and the stochastic magnetic field is a
background. After inflation the universe decelerates and approaches to the
radiation era. The range of the scale factor, when the causality of the model
and a classical stability take place, was obtained. The spectral index, the
tensor-to-scalar ratio, and the running of the spectral index were estimated
which are in approximate agreement with the PLANCK, WMAP, and BICEP2 data.
