A bill that bans students from using cellphones in schools was signed into law in Brazil on Monday, the latest example of lawmakers limiting young people’s use of personal technology in the classroom, amid growing concern about its effect on education and well-being.