System of magnetic particles in an external magnetic field: Surface and bulk structure