Upvote:4
Assuming you are Catholic, yes, your confession is valid. The Catechism of the Catholic Church discusses the penitent's participation in the sacrament around paragraphs 1450-1460. Your three duties are "contrition", "confession", and "satisfaction" (the latter being the part where you carry out the assigned penance and do your best to sin no more).
If the priest said the words of absolution but asked you not to say the Act of Contrition, that's fine. Priests will often do this if they have a lot of people waiting in line to receive the sacrament.
The main things that could result in an invalid or ineffective reconciliation would be if you weren't really contrite, didn't really intend to stop sinning, or if you deliberately chose not to reveal some of your mortal sins, or if for some reason the priest forgets to say the words of absolution.