Dollar gains after US payrolls beat forecast