Neutron powder-diffraction measurements have been performed to determi
ne the magnetic phase diagram of the YBa2(Cu1-xFex)3Oy system for an o
xygen concentration y close to 6.2. The temperature and concentration
dependence of the magnetic moments on the Cu1 and Cu2 sites have been
deduced from Rietveld refinements. At low temperature, the results sho
w the occurrence of a noncollinear phase for x < 0.03. At higher iron
content, a collinear phase is observed, with a doubling of the magneti
c unit cell along the c axis, and a moment muCu1 on the Cul sites whos
e absolute value increases with iron content. The succession of magnet
ic phases is well understood by a simple energy calculation. In the co
llinear phase, the sign of muCu1 with respect to the moment on the nei
ghboring Cu2 sites is correlated to the local iron environment and can
be modified through an appropriate heat treatment.