K.C.
B. -
At this early age kids are very curious about themselves and others. It is definitely the right time to talk to your daughter about what's appropriate and what's not. I agree with the other posters, but I would also like to add that a great lead in to the subject is to bring up what happened. So while you're explaining to your daughter that she has private parts that friends and big people shouldn't touch, you can say, "like when your friend at school the other day. He shouldn't have done that because he touched your private area." That way she can relate what you're saying to what actually happened. She may understand it more clearly.
Good luck!