Edge atoms effects on the perpendicular anisotropy of ultrathin magnetic layers