We give an upper bound for the error term in the Hardy-Ramanujan-Rademacher formula for the partition function. The main input is a new hybrid subconvexity bound for the central value L(21,f×(⋅q)) in the q and spectral parameter aspects, where f is a Hecke-Maass cusp form for Γ0(N) and q is a fundamental discriminant.