Noncommutative geometry and cosmology