The deletion-contraction method for counting the number of spanning trees of graphs