Contrastive Neural Ratio Estimation