In Control Panel>>> Sound>>> Playback tab, check that the default setting is pointing to the headphones/speakers.
(while the headphone is plugged in). When you unplug the headphone, it should automatically find the available playback output.
Sometimes it happens to me too but I just unplug and plug the jack back in until the system detects or responds to it. You can try that too.