First-principles study of the optical properties of SiC