We apply the renormalization group optimized perturbation theory (RGOPT) to evaluate the quark contribution to the QCD pressure at finite temperatures and baryonic densities, at next-to-leading order (NLO). Our results are compared to NLO and state-of-the-art higher orders of standard perturbative QCD (pQCD) and hard thermal loop perturbation theory (HTLpt). The RGOPT resummation provides a nonperturbative approximation, exhibiting a drastically better remnant renormalization scale dependence than pQCD, thanks to built-in renormalization group invariance consistency. At NLO, upon simply adding to the RGOPT-resummed quark contributions the purely perturbative NLO glue contribution, our results show a remarkable agreement with ab initio lattice simulation data for temperatures $0.25 lesssim T lesssim 1 , {rm GeV}$, with a remnant scale dependence drastically reduced as compared to HTLpt.