We determine the mass-radius relation of self-gravitating Bose-Einstein condensates with an attractive -1/r external potential created by a central mass. Following our previous work (P.H. Chavanis, Phys. Rev. D 84, 043531 (2011)), we use an analytical approach based on a Gaussian ansatz. We consider the case of noninteracting bosons as well as the case of self-interacting bosons with a repulsive or an attractive self-interaction. These results may find application in the context of dark matter halos made of self-gravitating Bose-Einstein condensates. In that case, the central mass may mimic a supermassive black hole. We apply our results to ultralight axions with an attractive self-interaction. We determine how the central black hole affects the mass-radius relation and the maximum mass of axionic halos found in our previous papers. Our approximate analytical results based on the Gaussian ansatz are compared with exact analytical results obtained in particular limits.