Virtual classes of representation varieties of upper triangular matrices via topological quantum field theories