Grand unified models and cosmology