Contrastive Learning as Goal-Conditioned Reinforcement Learning