Causal Contrastive Learning for Counterfactual Regression Over Time