Improving Fairness of Automated Chest X-ray Diagnosis by Contrastive Learning