Raising your magic is not at all affected by what spells you know. For example, raising magic from 1 to 4 and then learning Jump leaves it at the same cost as if you got Jump at 1 magic and then raised magic from 1 to 4. it's usually a bit silly to raise magic if you don't have any spells yet, though! XD
Keep in mind, though, that most spells (seven out of eight, in fact) only decrease at some levels. --- Nagas on a plane! ^_^
^^ yeah, the spells only decrease in magic bar use at a certain magic stat. These are fixed, not dependent on what magic level you're at when you receive that spell.
For example, the Fairy spell will always cost 2.5 bars of magic starting at Magic-6, iirc. 2.5 bars is the least that it 'downgrades' to. So even if you were already Magic-8 when you receive Fairy for the first time, it will stay 2.5 bars of use. At Magic-5 and less than that, I think it's more than 2.5 bars.
So to answer your question, the Magic stat upgrade will include the spells you haven't received.