Understanding the properties and limitations of contrastive learning for Out-of-Distribution detection