Faster algorithms for counting subgraphs in sparse graphs