The thermoelectric figure of merit (ZT) of gated silicon nanowires with square cross section has been calculated by solving the Boltzmann transport equations for electrons and phonons. The electrical conductivity, electronic Seebeck coefficient, and electronic thermal conductivity were calculated by including electron scattering from confined acoustic phonons, intervalley phonons and imperfections at the Si/Si02 interface. Three-phonon scattering and boundary scattering were included in the calculation of the lattice thermal conductivity. The Seebeck coefficient, electrical conductivity, and thermal conductivity vary non-monotonically with the variation of the wire cross section mainly because of the non-uniform variation of the electron mobility with the wire cross section. In particular, when the wire cross section is decreased from 8x8 nm2 to 3 x 3 nm2, ZT increases initially, reaches a maximum value ZT = 0.11 for a 5 x 5 nm2 wire, and then decreases with further reduction of the wire cross section.