The loss on Sunday left the Liberal Democrats a minority party in both houses of Parliament, while two new nationalist parties surged.