Nonparametric covariate adjustment in estimating hazard ratios