The gravitational lensing effect of magnification bias can manifest itself through a nonzero measurement of the cross-correlation between two samples of galaxies with nonoverlapping redshift distributions. Given the dependance of the magnification bias signal on cosmology and since submillimeter galaxies are an optimal background sample for this kind of study, this work makes use of galaxy samples from the H-ATLAS and GAMA II catalogs to measure the cross-correlation between them. By means of a halo model description of the signal, observational restrictions on the dark matter halo mass function are obtained under a Planck cosmology, both in a nontomographic and a tomographic setting. Whereas results are only compatible with those from numerical simulations for the former case, mainly due to the large error bars, a tomography-based approach provides a remarkable improvement regarding uncertainties. In fact, compared to N-body results, our approach predicts a higher number density of dark matter halos for masses below 10^13 solar masses and a steeper fall for masses above 10^14.5 solar masses.