Explaining and Mitigating the Modality Gap in Contrastive Multimodal Learning