Polarized radiative transfer in planetary atmospheres and the polarization of exoplanets