Magnetic interactions in systems with reduced dimensionality