Contrastive Learning of Preferences with a Contextual InfoNCE Loss