A cosmological model describing the different stages of the universe, i.e.: inflation, radiation dominated period and matter dominated (Friedmann-like) period is shown. The model consists of the usual gravitational lagrangian with aσ R2 term, and, for the matter content, the lagrangian of a massive conformally coupled scalar field. The effect of backreaction is evaluated by means of an extremum condition on the entropy at each time. The differential equation, obtained when the lowest quantum order is considered, describes all the periods of evolution of the universe. For a range of values ofσ, inflation is unstable and the universe can reach the following regime.