An upper bound for the number of spanning trees of a graph