VPNOnly is a tweak that blocks all outgoing traffic from your Wifi connection that is non-VPN. VPNOnly is compatible with iOS 4 and 5 and is accessible through the Settings app. It displays a badge in the status bar when active. VPNOnly comes with caveats, of course; you have to set up your VPN manually, and an option for automatically restarting the VPN connection on a disconnect is not currently available.

Credits to iJailbreak for the image.

This tweak is available for $3 from the BigBoss repo.