A biochemical mechanism for bacterial chemotaxis