Luminosity and stellar mass functions of discs and spheroids in the SDSS and the supermassive black hole mass function