US president Barack Obama has visited the city of Flint in the state of Michigan following its water contamination crisis.