Measurement of polarized quark distributions at HERMES