How to create polygons with straight lines and right angles in QGIS?
There is a Shape Digitizing toolbar in which has an option to add rectangle using different methods:
To show the toolbar, right-click the main menu and select Shape Digitizing toolbar
I am using QGIS 3.4.
For QGIS 3: See ahmadhanb's answer.
Original answer:
Check the CadTools plugin. It offers orthogonal line tools. Here's what the help says:
I tried the suggested solutions but found the CADTools plug-in a bit too complicated to get a quick hang of it. Besides, this is a rather simple task.
Instead I found the plug-in Rectangles Ovals Digitizing by Pavol Kapusta. The name is rather self explanatory and it works excellently. You can draw shapes from centre or by extent.