Neutrinos in astrophysics and cosmology