Counterfactual Representation Learning with Balancing Weights