Routing Wires in a Bathroom
There are no rules for routing cabling other than it must be protected from damage and properly strapped down. However, you question opens up another problem. 

First if you light power is coming from the switch you do not have a hot wire in the fixture. 

Second the NEC 210.52 (D) states that the receptacle should be within 36" of the basin but not over the basin.

Third NEC 210.11 (C) (3) Requires the GFCI receptacle to be a 20A dedicated circuit. Exception, if the 20A circuit is only  feeding one bathroom you can connect the light and the exhaust fan to the same circuit.

Hope this helps