Planetary habitability and stellar activity