Why is human vision restricted to 400-700 nm?
Short answer
The visible spectrum has the highest energy in sunlight at the earth's surface, explaining the gross location of the visible spectrum in life on earth. The specific frequency range varies across species and can be explained by species-specific survival strategies.

Background
When you look at the solar light spectrum at the earth's surface the visible spectrum has the highest intensity (fig. 1).


Solar irradiation. Source: University of California.

So it makes sense to use the range of frequencies that is represented most in sunlight as a starting point.  

Then the question becomes, why do humans utilize approximately 400 to 700 nm, and not infrared or UV? That can be explained because we do not need it. Our range has been hypothesized to be related to foraging behaviors and our visual system is particularly sensitive in the frequency range of the coloring of (ripe) fruits, which is thought to have been of great benefit to our hominid ancestors (Osorio &amp; Vorobyev, 1996).

Why then do animals extend their vision into UV? Many fish, amphibian, reptilian, avian, and some mammalian species use UV vision. Many birds can identify UV-reflected nectar and berries, and UV-reflecting plumages in birds, and scales in fishes are used for recognition (Shi &amp; Yokoyama, 2003). Moreover, some arthropod species are know to use UV vision to reduce light-reflection distortions under water, such as in the mantis shrimp that features 12 photoreceptor types (as opposed to four in humans) (Thoen et al., 2014).

Why then do animals extend their dynamic range into the infrared? A notable beneficial effect of perceiving infrared is the detection of body heat. The generation of heat is accompanied by the generation of infrared light. The detection of this emitted light is highly useful for nocturnal predators, like the rattle snake (Hartline &amp; Newman, 1982).

References
- Hartline &amp; Newman, Sci Am (1982); 246(3): 116-27
- Osorio &amp; Vorobyev, Proc Roc Soc B (1996); 263(1370)
- Shi &amp; Yokoyama, PNAS (2003); 100(142003): 8308-13
- Thoen et al., Science (2014); 343(6169): 411-3 

Further Reading
1. Is our color vision calibrated to sky, vegetation, and blood?
2. Is there a physical reason for colors to be located in a very narrow band of the EM spectrum?