I wish that I had noticed this thread back when Marcelo had first asked his question. Hope you're still reading it.
Nicko, thanks for passing on the mind-calming technique that you learned from your Tai-Chi teacher. I'll definitely use it. I also agree that there is some great advice, especially on breathing, in this thread. I give a class that focuses on static apnea for the freediving club that I belong to and I hope that I can contribute to the conversation. Most of the work that we do involves breathing, relaxation and imagery, and I do confess to a penchant for the more esoteric side of mental training for freediving. Marcelo asks specifically about how to relax after contractions begin, so I hope this helps.
As others have posted on this forum CO2 contractions are vital survival signals to us, and it would be ill advised to try and eliminate them or postpone them by hyperventilating. We need to accept them, as unpleasant as they can be, and based on this I'd like to offer a mental trick that we work with. Contractions are like an alarm bell, telling you to get out of the water and breathe. What you need to do is to change the message associated with that bell. We do mental training to this effect, with autogenic scripts, visualizations and mindfulness training so that the bell rung by the contractions tells us to find the way back to our state of relaxation. The bell no longer sounds like a fire alarm, but like a tibetan singing bowl sounding at regular intervals. Instead, the bell says, "Bring your attention to your shoulders/neck/jaw/tongue/eyeballs. Are they relaxed? If not, let them fall." A lot of time passes when you scan the body and make small adjustments like this - kind of like a focused daydream. In that daydream, you can think of yourself steering a small boat that is flowing down a river. You don't want to abandon the rudder, or make any sharp turns, but you steer with a light touch, just enough to feel the current and to follow it downstream. This is the way back to a relaxed state; back to the middle of the river.
However, don't get too comfortable here: there are rapids ahead that you need to navigate without capsizing. Be aware of where they are, because when you get there you need to be on the lookout for the end of the river. You may not even see it, which is why you need to navigate this river often: so that you have a better sense of where the waterfall is. You need to plan your exit so that you can confidently bring your boat to the riverbank before you go over that waterfall.
In other words, when you experience contractions don't try to ignore them or impose too much control over them - observe them if you can, let them happen and assure yourself that you can go longer with the air you have. With practice you get over the hard part and you just get into the rhythm of letting the contractions pass over you like a breaking wave, but after a certain time you also need to be vigilant for hypoxic symptoms leading to a loss of consciousness, as Bussard pointed out in an earlier post. For this you need to learn about your body and know your limit; anticipate it, but remember that it is an approximate limit. (Always dive with a buddy!!) Before you get there you change up your style; you open your eyes and look out for any change in the quality of your vision (colours, tunnel vision, darkening, blurring, etc.), move the air in your lungs from the chest to the abdomen and back (but don't let any air out), and there are other motions or games you can perform to stay aware. In static apnea, this is where you put both hands on the edge of the pool and prepare to get out.
I know that most of this seems to be intended for static apnea, but there are some of the visualizations and attitudes here that can transfer to depth disciplines. For example, you can check those shoulders and that jaw as the hydrostatic pressure builds. Are the shoulders tensed up? is the jaw clenched? Slow down, relax those tense parts, and only then continue your descent. In this way, you are not waiting to become uncomfortable before trying to relax, and already being relaxed should help you to accept the contractions when they do eventually begin. In other words, the closer you stay to the middle of the river, the less you have to steer against the current to find your way back to it.