Swedish prime minister admits defeat as right-wing bloc claims slim election win