Advancing Counterfactual Inference through Quantile Regression