The deposition angle dependence of the in-plane magnetic anisotropy in ultrathin Co films on Cu(001) has been investigated by using the magneto-optic Kerr effect. Grazing-incidence molecular beam epitaxy of Co has been found to result in a uniaxial magnetic anisotropy, whose strength increases with increasing deposition angle. The measured magnetic anisotropy is related to the formation of elongated adatom structures during growth. Calculations of the deposition dynamics reveal that the uniaxial magnetic anisotropy and surface morphology originate from a redistribution of incident atom flux. This redistribution is caused by long-range attractive forces between incident atoms and substrate atoms.