A fee agreement which is in whole or in part contingent shall be in writing and shall state the method by which the fee is to be determined, including the percentage or percentages that shall accrue to the lawyer in the event of settlement, trial or appeal, litigation and other expenses to be deducted from the recovery, and whether such expenses are to be deducted before or after the contingent fe