This:
It happens before the damage is applied. The damage dice must be rolled before Uncanny Dodge can halve the damage, of course. You could say that Uncanny Dodge's timing interrupts damage taking. There's absolutely no reason to think it also interrupts reaction denial.
I've bolded the key thing -
Uncanny Dodge's timing
interrupts damage.
Since the reaction interrupts (i.e. occurs prior to) the damage, it has to occur prior to the effects as well, since the effects either occur at the same time as damage, if not after damage, as indicated in Step 3 of Making an Attack in the Basic Rules and PHB.
The reaction doesn't postpone the timing of the damage, to cause it to occur later in the sequence -- if it actually postponed the damage after the effect, then I could see an argument for the effect negating the reaction, but since it must interrupt the damage event, it must interrupt any simultaneous or subsequent event. Note that it's not preventing the effect of
Shocking Grasp, but just halving the damage.
Either way, the target is burning their reaction against the attack, having the desired effect of preventing further reactions until the target's next turn.
At 5th level, when
Uncanny Dodge becomes available, a like leveled
Shocking Grasp would cause 6 damage, on average, with
Uncanny Dodge preventing an average of 3 damage -- considering RAF (Rules as Fun), it seems nitpicky to go to such an extreme ruling on RAW, where it's a stretch to rule that it doesn't occur before the damage (and effect), since the desired effect, using
Shocking Grasp to prevent the target's meaningful use of a reaction, for say
Counterspell or an opportunity attack.
I say let the player burn the reaction to reduce the 3 damage.