Energy-Based Contrastive Learning of Visual Representations