In the past years, there have been many advances –but also many debates– around mutualistic communities, whose structural features appear to facilitate mutually beneficial interactions and increase biodiversity, under some given population dynamics. However, most approaches neglect the structure of inter-species competition by adopting a mean-field perspective that does not deal with competitive interactions properly. Here, we build up a multilayer network that naturally accounts for mutualism and competition and show, through a dynamical population model and numerical simulations, that there is an intricate relation between competition and mutualism. Specifically, the multilayer structure is coupled to a dynamical model in which the intra-guild competitive terms are weighted by the abundance of shared mutualistic relations. We find that mutualism does not have the same consequences on the evolution of specialist and generalist species, and that there is a non-trivial profile of biodiversity in the parameter space of competition and mutualism. Our findings emphasize how the simultaneous consideration of positive and negative interactions derived from the real networks is key to understand the delicate trade-off between topology and biodiversity in ecosystems and call for the need to incorporate more realistic interaction patterns when modeling the structural and dynamical stability of mutualistic systems.