Diagrams of rocket engines like this one,



(source)

always seem to show a combustion chamber with a throat, followed by a nozzle.

Why is there a throat? Wouldn't the thrust be the same if the whole engine was a U-shaped combustion chamber with a nozzle?

The whole point to the throat is to increase the exhaust velocity. But not just increase it a little bit -- a rocket nozzle is designed so that the nozzle chokes. This is another way of saying that the flow accelerates so much that it reaches sonic conditions at the throat. This choking is important. Because it means the flow is sonic at the throat, no information can travel upstream from the throat into the chamber. So the outside pressure no longer has an effect on the combustion chamber properties. 

Once it is sonic at the throat, and assuming the nozzle is properly designed, some interesting things happen. When we look at subsonic flow, the gas speeds up as the area decreases and slows down as the area increases. This is the traditional Venturi effect. However, when the flow is supersonic, the opposite happens. The flow accelerates as the area increases and slows as it decreases. 

So, once the flow is sonic at the throat, the flow then continues to accelerate through the expanding nozzle. This all works together to increase the exhaust velocity to very high values. 

From a nomenclature standpoint, the throat of a nozzle is the location where the area is the smallest. So a "U-shaped chamber with a nozzle" will still have a throat -- it's defined as wherever the area is the smallest. If the nozzle is a straight pipe then there is no throat to speak of.
