There's double-sided tape on Amazon that was made specifically for this purpose. I highly recommend getting some (the one I got is called MaskTite). FYI once you "stick" it onto your nose, it's better to just leave it like that if you can—it will lose stickiness or twist/stick to itself if you keep taking the mask off.
During the exam, when I needed water or snacks, I would just lift up the bottom of the mask and leave the top stuck to my nose. Felt a little like a Hungry Hungry Hippo but it did the job.