When Razzak then decieved McCullum and trapped him in front with what turned out to be the last ball of the day, the home side left the field with their heads held high.
Earlier in the day, McCullum won the toss and elected to bat, which saw Hamish Rutherford (34) and Peter Fulton (73) put on 57 for the first wicket before Rutherford tried one big stroke too many from the spin bowling of Sohag Gazi and was caught at mid-off.
Rutherford's departure brought Williamson and Fulton to the crease and the pair ground out 126 for the second wicket before Fulton flashed a loose shot to cover and was dismissed just before the tea interval from the part-time off-spin of Nasir Hossain.
Williamson looked at ease against the buffet of spin bowling served up Rahim, and he brought up his century with a streaky late cut from the bowling of Razzak in the 78th over of the day.
Taylor's departure brought McCullum to the crease, who showed his intent early on as he flicked his second delivery through the onside for four and Bangladesh promptly took the new ball when it became available.
It didn't take long for the Bangladesh spin bowlers to come in to the contest and Razzak was called upon in only the sixth over the day and he eventually wheeled down 31.5 overs for a return of 2-100 in his first test since August, 2011.
Gazi was also gainfully employed as he got through a power of work and finished with 1-56 from his 23 overs.
Curiously, Hossain only bowled two overs despite picking up the scalp of Fulton.
Black Caps coach Mike Hesson picked the promising leg-spinner Ish Sodhi and all-rounder Corey Anderson to make their first test appearances and while both are green at first-class level they will have a prime opportunity to press their case to be part of the team's future.
Sodhi will bowl alongside left-arm finger spinner Martin during this test with only two frontline seamers - Trent Boult and Doug Bracewell - in the New Zealand playing XI.
Bangladesh also named a debutant for the match with the selection of 24-year-old top-order batsman Marshall Ayub.
New Zealand, who have plenty of batting to come with Anderson and BJ Watling, will need to push their total towards 400 on day two as they look to set themselves up in the test.