The prime minister’s Liberal Party retained power in Monday’s election but fell short of a majority.