Portuguese prime minister finishes visit to Algeria