A smaller number of workers quit their jobs in July, as businesses hired fewer workers and layoffs rose.