Estimating median and other quantiles in nonparametric models