How do you say it? Do you back-track it by saying "wasn't allowed to... at any cost"? Or, if you mustn't talk, you just say "I had to stay quiet." ?
Yes, you have to rephrase. You must not speak, if it were put into the past tense without rephrasing, would end up having a different meaning or would just be wrong. I must not spoke. This is simply incorrect grammar and is meaningless in modern English. I must not have spoken. This has meaning, but it doesn't mean one was forbidden from speaking; it means uncertainty in whether one did or did not speak. It's another way to say, I guess I didn't speak. It could also deliver irony/sarcasm in having said something, but no one having paid any mind to what you said.