Safe location rules for bathroom sink receptacle and light switch
National Electrical Code says that the receptacle must be within 3' of the outside edge of the basin, but not more than 12" below the top of the basin (210.52(D)). It also states that the receptacle can be installed in the countertop, but must not be in the face-up position (406.5(E)).

Obviously the receptacles must be GFCI protected, since they're in a bathroom (210.8(A)(1)).

See also this answer from @Shirlock Homes.


  National Electrical Code 2014
  
  Chapter 2 Wiring and Protection
  
  Article 210 Branch Circuits
  
  210.52 Dwelling Unit Receptacle Outlets.
  
  (D) Bathrooms. In dwelling units, at least one receptacle
  outlet shall be installed in bathrooms within 900 mm (3 ft)
  of the outside edge of each basin. The receptacle outlet
  shall be located on a wall or partition that is adjacent to the
  basin or basin countertop, located on the countertop, or
  installed on the side or face of the basin cabinet. In no case
  shall the receptacle be located more than 300 mm (12 in.)
  below the top of the basin. Receptacle outlet assemblies
  listed for the application shall be permitted to be installed
  in the countertop.
  
  210.8 Ground-Fault Circuit-Interrupter Protection for
  Personnel. Ground-fault circuit-interrupter protection for
  personnel shall be provided as required in 210.8(A) through
  (C). The ground-fault circuit-interrupter shall be installed in
  a readily accessible location.
  
  (A) Dwelling Units. All 125-volt, single-phase, 15- and
  20-ampere receptacles installed in the locations specified in
  210.8(A)(1) through (10) shall have ground-fault circuitinterrupter
  protection for personnel.
  
  (1) Bathrooms
  
  210.11 Branch Circuits Required.
  
  C) Dwelling Units.
  
  (3) Bathroom Branch Circuits. In addition to the number
  of branch circuits required by other parts of this section, at
  least one 20-ampere branch circuit shall be provided to
  supply bathroom receptacle outlet(s). Such circuits shall
  have no other outlets.
  
  Exception: Where the 20-ampere circuit supplies a single
  bathroom, outlets for other equipment within the same bathroom shall be permitted to be supplied in accordance
  with 210.23(A)(1) and (A)(2).
  
  Chapter 4 Equipment for General Use
  
  Article 406 Receptacles, Cord Connectors, and Attachment Plugs (Caps)
  
  406.5 Receptacle Mounting.
  
  (E) Receptacles in Countertops and Similar Work Surfaces.
  Receptacles shall not be installed in a face-up position
  in countertops or similar work surfaces.


NOTES:

As @ArchonOSX points out, there must be at least one 120-Volt 20-ampere circuit supplying the bathroom small appliance branch circuit. This circuit can have no other outlets, unless it only supplies equipment in a single bathroom and any other outlets are in accordance with 210.23(A)(1) and (A)(2). (See 210.11(C)(3) above)