As has already been mentioned, the problem is most likely that your flash's range is inadequate to light up the background. As such, only the area illuminated by the flash contributes to the photo and the rest of the scene is greatly underexposed.
Some possible solutions that I can think of are:
Get an external flash with much greater range (preferably one that can be used as bounce flash for more "natural-looking" indoor shots).
Use your camera's slow sync flash mode so that the ambient light contributes to the photo as well, but this means that you will have to use a slow shutter speed.
If you are able to control the conditions for your photo shoot, move your subject closer to a wall or other solid background so that all the elements of the photo will be within your flash's range (but watch out for reflections from shiny objects). If you can make the ambient lighting conditions brighter, so much the better.