Magnetically confined states and transport property on the surface of a topological insulator