The reaction to the lumbar puncture is a mechanical thing - your spine is objecting to the change in pressure, and that has lots of unpleasant knock-on effects.
The MRI contrast agent if it is used is NOT put into your spine - it's given in an IV. So there shouldn't be any pressure change associated with it.
Hope all goes OK.