Your friend is correct. You were threatened with physical violence and coerced into sex. Coercion isn't consent. No one has to physically force you or hurt you to rape you.
"In a relationship where sexual coercion is occurring, there is a lack of consent, and the coercive partner doesn’t respect the boundaries or wishes of the other." From an article on coercion:
What is Sexual Coercion? ? www.loveisrespect.org