Counting partitions of a fixed genus