Semiparametric estimation of structural functions in nonseparable triangular models