Terrorism returns to haunt world markets after Madrid blasts