Which audio chipset does your PC have? On systems with Realtek HD Audio, the manufacturer's Audio Manager app provides an option under Advanced Device Settings to either treat both front and rear output jacks as the same, or as different devices. The latter setting allows users to play back different audio streams simultaneously, and each output device will have a separate volume control displayed by the mixer.
Search for a similar setting for your audio device, and select the option to tie both jacks together. That way, you can use the same button to mute both output devices simultaneously. If you don't want to do this or cannot find such an option (maybe the Windows 8 audio driver from the manufacturer still lacks it), in Windows 7 at least the mixer allows you to select the different output devices from a drop-down menu (see screenshot below). I'm sure Windows 8 should allow you to do this as well. You can select the front jack output device (headphones) and then mute it, although this way is more of a pain since you'll need to remember to switch back to the rear jack output device (speakers) when you want to mute those instead.