The UK science community draws vital benefits from EU membership and could lose influence in the event of an exit, says a House of Lords report.