The crash killed at least 17 people and injured 20 more, some critically, Portuguese authorities say.