Contrastive learning of global and local features for medical image segmentation with limited annotations