As both Spain and Portugal are part of the EU, you will have no hassles taking your cheap car hire in Malaga across the border into Portugal. Most car rental companies will allow this, on condition that you fill them in with your plans, sign the correct border crossing documentation, and secure your insurance for both territories. You should, of course, take your passport along and keep all documentation in a safe place. Search car hire on KAYAK