There is a bug on Windows 7 that prevents the Nexus 4 to charge when it's connected to a USB port. The problem seems to be related to the latest Nexus 4 update in combination with the Windows USB driver. Luckily there is a workaround to this problem: simply disable MTP mounting on the Nexus 4:
Go to Settings > Storage > Menu > USB Computer Connection
Unclick Media Device (MTP)
The Nexus 4 should now charge when plugged into a Windows 7 computer.