I'm attracted to my friend and I accidentally took a peek at them.
I hope you're joking, why did you take a peek at him?
I wanted to see what nipples he had.
It's understandable to have urges and to want to satisfy your curiosity. You shouldn't spy on your friends especially when you're taking a look at their private parts, if you have any form of attraction you should communicate this with them. Continuing the spy on your friend could result in them finding out and them not wanting to be friends anymore.
Nah, I'm going to do it again.
You really should reconsider, I'm sure he trusts you as a friend and you shouldn't break that trust by continuing to spy on him naked.