Did you or your friend actually get ketamine effects?
I think most of the time a headache (assuming it is not secretly migraine or cluster headache instead) is caused by expanding or contracting bloodvessels in the brain, dehydration, tension or (really not sure about this one but perhaps) oxidative stress related factors. Then again: like the latter, chemicals may also be a cause / source for a wide variety of reasons and it would be a bit too coincidental if you got the pain immediately after snorting. That said I can't really make a meaningful link between ketamine and headaches right now - especially the kind that would persist for days - and it seems just as likely that there were other compounds you snorted that may have been the reason.
With that in mind it seems like a good idea to see a doctor of you continue to have this problem. A good doctor would probably ask you about the type of sensation, since there is quite a range of types of pain - that might narrow it down a bit, if I were you I would try my best to describe it well e.g. trobbing / piercing / nagging / pressure-y etc, even if you aren't asked about it that way.