Publicly-owned shipyard Ferguson Marine has missed out on the contract to build seven new ferries, it has been announced.