Hybrid metric-Palatini gravity: applications to cosmology and astrophysics