Mr Rahman, who is very popular in India, was responding to a religious edict, or “fatwa”, by a Muslim organisation against him and the Iranian director of the film, Majid Majidi.
The big-budget film, Muhammad: The Messenger of God, was released in Iran earlier this year and at the Montreal World Film Festival last month.
In a message on his Facebook page, Mr Rahman said his decision to compose the music was made in good faith and with no intention of causing offence.
In the message, the composder said the intention of the film was to “unite humanity, clear misconceptions and spread [the] message that life is about kindness”.
The film has caused controversy in several Arab countries. Islamic law generally opposes any depiction of the prophet, even favourable ones, for fear it could lead to idolatry.
The Mumbai-based Raza Academy has urged Muslims not to watch the movie, calling it a “mockery” of Islam. It ordered Rahman to reaffirm his faith by reciting the tenets of Muslim belief and repeating his marriage vows, to re-establish his status as a Muslim.
Similar orders were passed against Mr Majidi as well.
In the fatwa, that was issued last week, the Raza Academy demanded that the Indian government ban the screening of the film, which narrates the story of the prophet’s life from birth to the age of 13.
Since he began composing music for films in 1992, Mr Rahman has composed music and background scores for about 130 films in several Indian languages. In 2009, he received Academy awards for best song and original score for the film Slumdog Millionaire.
He has also composed the background scores for Hollywood films, 127 Hours, Million Dollar Arm and Hundred Foot Journey, and he has collected a Bafta award, two Grammy Awards and a Golden Globe for his work.
The 48-year-old musician was born a Hindu, but converted to Islam in 1989 and adopted the name Allah Rakha Rahman.
Mr Rahman was born a Hindu, but converted to Islam in 1989 at the age of 23, changing his name from RS Dileep Kumar to Allah Rakha Rahman.