The natural convection in a square cavity with a heated horizontal plate containing a nanofluid (water and Ag) is simulated numerically. The heated plate and vertical walls are maintained at a constant temperature, Th and Tc, while the horizontal walls are adiabatic. The nanofluid is assumed to be incompressible and the flow is considered to be laminar. The continuity, momentum and energy equations written in terms of the primitive variables are discretized using a control volume approach and the SIMPLER algorithm. A parametric study is performed and the effect of the Rayleigh number, the location of the heated plate and the volume fraction of the nanoparticles on the fluid flow and the heat transfer inside the cavity are investigated. The results show that the mean Nusselt number of the vertical walls increases with increasing the volume fraction of the nanoparticles. Moreover, for a constant volume fraction of the nanoparticles, the Nusselt number of the vertical walls decreases substantially as the location of the heated plate varies from top to bottom of the cavity.