Nucleonic matter is described within an SU(2) extended Nambu-Jona-Lasinio (NJL) model. Several parametrizations with different nuclear matter saturation properties are proposed. At subsaturation, nuclear pasta phases are calculated within two methods: the coexistence-phases approximation and the compressible liquid drop model, with the surface tension coefficient determined using a geometrical approach at zero temperature. A unified equation of state of stellar matter for the inner crust, with the nuclear pasta phases, and the core is calculated. The mass and radius of neutron stars within this framework are obtained for several families of hadronic and hybrid stars. The quark phase of hybrid stars is described within the SU(3) NJL model including a vector term. Stellar macroscopic properties are in accordance with some of the recent results in the literature.