In this work, the problem of designing an optimal regulator for discrete-time nonlinear systems when the plant can be modelled by a Takagi-Sugeno (TS) fuzzy system is addressed. The approach analyzed in this paper, under certain conditions, guarantees the tracking of references and allows the performance of the controller to be improved by means of the inclusion of some cost functions. The main result is given in terms of linear matrix inequality techniques, meaning that the design of the controller can be obtained in a practical way. Finally, numerical simulations are carried out in order to illustrate the validity of the fuzzy regulator.