Counting points on surfaces by counting points on curves