The spanning tree problem with one quadratic term