Algeria's president has dismissed his prime minister and replaced him with a loyal supporter, the president's office says.