Optical magnetism and wavefront control by arrays of strontium atoms