The trace on projective representations of quantum groups