Measurement of the polarization of tau leptons produced in Z decays