President Andry Rajoelina has vowed to remain in office despite violent protests against his government.