Optimal asset allocation for a bank under risk control