Well, this can be challenging because they are a figure of authority in your life that seems to be misusing that authority. Some points to recognize first:
It is inappropriate for your teacher to be interrupting an entire class so that you can help her with her personal IT issues, such as configuring her iCloud in the middle of a class.
It is not your job to do this, you are a student in the class. Not her personal assistant.
She is abusing her figure of authority to intimidate you into doing something that both you and her know is inappropriate at this time.
Possible Responses:
Option 1: Simply her that you would rather not help with this task as it will be disruptive to the class. Say something like, "I know that you want me to help you configure your iCloud, but right now we are in the middle of lecture and it would take me the rest of the class period to do this. Are you sure you want to interrupt class for this?"
A response like this forces her to acknowledge that A. This will disrupt the rest of class B. She should not be asking you to do this right now, and C. Give her a way to return to the lecture without causing any issues.
If she still wants you to move forward and interrupt class, you could just tell her that you do not feel comfortable with helping her to handle a personal IT issue right now.
If she escalates and sends you to the principal's office, just explain the entire situation to the principal. Your administrator should side with you on this topic, as your teacher should not be interrupting class, or be on her phone all the time like this.
If you feel especially nice, tell her that you would be more than willing to come back at lunch or study hall and to help her, but you feel that it is inappropriate and unfair to the other students to interrupt the entire class to do that right now.
Option 2: Do what she asks and go to an administrator later.
You can always just do what she asks and go to the office later and ask to speak to her supervisor (The Principal or Vice Principal, maybe the Superintendent if it is a smaller school). Explain the situation to them and tell them that it made you uncomfortable and that you feel like class should not be disrupted due to situations like this.
It is their job to ensure a smooth learning experience, and to make sure that class is not interrupted, especially if this is a regular occurrence.
Option 3: If you do not want to face her, or an administrator directly you can always talk to your parent/guardian about it.
Chances are that your parent/guardian wants you to get a good education, and if a teacher is interrupting that, they will want to know. Especially if they are using their authority to make you do personal tasks for them. Your parent can always schedule a meeting with the administrators at your school, and you can go with them if you wish. This may reduce the intimidation factor of having to face this situation alone.
Option 4: Just leave it be.
If you really aren't all that concerned and nobody else seems to be either, recognize that maybe it isn't that big of a deal to escalate. Unless this becomes a very regular occurrence or source of disruption, you can just chalk it up to being a one time thing and let it go.
Overall, these types of situations will happen in life, and if you learn to stick up for yourself, while being kind and respectful, it will go a long way to resolve the issue. Try not to manufacture conflict, just think of the best ways to resolve it and ask for advice (like what you are doing right now). Also, good job on becoming the go-to person for IT issues! In the future workplace, being a go-to person to help solve problems because you are knowledgeable can make you a valuable addition to any team. Keep up the good work!