The quantization in quadratic order of the Hitchin functional, which defines by critical points a Calabi-Yau structure on a six-dimensional manifold, is performed. The conjectured relation between the topological B-model and the Hitchin functional is studied at one loop. It is found that the genus one free energy of the topological B-model disagrees with the one-loop free energy of the minimal Hitchin functional. However, the topological B-model does agree at one-loop order with the extended Hitchin functional, which also defines by critical points a generalized Calabi-Yau structure. The dependence of the one-loop result on a background metric is studied, and a gravitational anomaly is found for both the B-model and the extended Hitchin model. The anomaly reduces to a volume-dependent factor if one computes for only Ricci-flat Kahler metrics.