Teach children about dangers of 'sexting' and pornography at school, first official guidance on online education says